package serviceImpl;

import java.util.ArrayList;

import dao.MessageDao;
import daoImpl.MessageDaoImpl;
import pojo.Message;
import pojo.MessageComment;
import pojo.User;
import service.MessageService;

public class MessageServiceImpl implements MessageService{

	public ArrayList<Message> getAllMessage() {
		MessageDao md = new MessageDaoImpl();
		ArrayList<Message> messageList = md.getAllMessage();
		return messageList;
	}

	@Override
	public Message getSingleMessage(int mid) {
		MessageDao md = new MessageDaoImpl();
		Message message = md.getSingleMessage(mid);
		return message;
	}

	@Override
	public User getUserInfo(int userid) {
		MessageDao md = new MessageDaoImpl();
		User user = md.getUserInfo(userid);
		return user;
	}

	@Override
	public ArrayList<MessageComment> getMessageComment(int mid) {
		MessageDao md = new MessageDaoImpl();
		ArrayList<MessageComment> mcList = md.getMessageComment(mid);
		return mcList;
	}

	@Override
	public int sendMcComment(int mid, int userid, String mcComment) {
		MessageDao md = new MessageDaoImpl();
		int suc = md.sendMcComment(mid,userid,mcComment);
		return suc;
	}

}
